#pragma once
#include "SymmetricKey.h"
#include <string>
#include <fstream>

namespace kryptos { namespace cryptography {

class SymmetricKeyFile : public SymmetricKey
{
public:
    SymmetricKeyFile();
    SymmetricKeyFile(const std::string& id, const std::string &filepath, bool reuseWhenFinished=false);
    SymmetricKeyFile(const std::string &filepath, bool reuseWhenFinished=false);

    virtual ~SymmetricKeyFile();

    virtual void change(const std::string &filepath, bool reuseWhenFinished=false);

    virtual void reset();

    virtual void goBack   (unsigned long long len);
    virtual void goForward(unsigned long long len);

    virtual bool isValid();

    virtual std::vector<char> nextBytes(int len);

protected:

    void init(const std::string &filepath);

    std::ifstream keyfile;
};

}}
